<div class="main-content">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <ol class="breadcrumb">
                    <li>
                        <i class="clip-file"></i>
                        <a href="#">
                            Logística
                        </a>
                    </li>
                    <li class="active">
                        Almacén
                    </li>					
                </ol>
                <div class="page-header">
                    <h1>Nota de Pedido <small>Formulario</small></h1>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <!-- start: DYNAMIC TABLE PANEL -->
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="icon-external-link-sign"></i>
                        Productos
                        <div class="panel-tools">
                            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
                            </a>
                            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                                <i class="icon-wrench"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-refresh" href="#">
                                <i class="icon-refresh"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-expand" href="#">
                                <i class="icon-resize-full"></i>
                            </a>
                            <!--<a class="btn btn-xs btn-link panel-close" href="#">
                                <i class="icon-remove"></i>
                            </a> -->
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-md-12">
                                <form class="form-horizontal">
                                    <div class="row">
                                        <div class="col-md-2">
                                            <div class="form-group">
                                                <label for="numero" class="col-sm-4 control-label">Número</label>
                                                <div class="col-sm-8">
                                                    <input type="hidden" id="pagina" value="notaPedido">
                                                    <input type="hidden" id="oper" value="add">
                                                    <input type="text" id="numero" value="<?php echo $codigo; ?>" readonly="readonly" name="numero" class="form-control">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-4">
                                            <div class="form-group">
                                                <label for="suc" class="col-sm-3 control-label">Sucursal</label>
                                                <div class="col-sm-9">
                                                    <?php
                                                    $css = 'class="form-control search-select" id="sucDest" placeholder="Seleccione sucursal"';
                                                    echo form_dropdown("sucDest", $sucursales, null, $css);
                                                    ?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label for="fecPedido" class="col-sm-3 control-label">Fecha</label>
                                                <div class="col-sm-8 input-group">
                                                    <input type="text" id="fecPedi" data-date-format="dd-mm-yyyy" data-date-viewmode="years" class="form-control date-picker">
                                                    <span class="input-group-addon"> <i class="icon-calendar"></i> </span>
                                                </div>
                                            </div>  
                                        </div>
                                        <div class="col-md-2">
                                            <div class="form-group">

                                            </div>  
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <hr/>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-horizontal">
                                    <div class="row">
                                        <!--   <div class="col-md-2">
                                               <div class="form-group">
                                                   <label for="cantPed" class="col-sm-3 control-label">Filtro</label>
                                                   <div class="col-sm-9">
                                                       <select id="tipoFiltro" class="form-control" style="width: 125px">
                                                           <option value="desc_prod">Descripción</option>
                                                           <option value="modelo">Modelo</option>
                                                           <option value="desc_marca">Marca</option>
                                                       </select>
                                                   </div>  
                                               </div>  
                                           </div>  -->                                       
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label for="descProd" class="col-sm-2 control-label" style="margin-left:20px; width: 70px">Producto</label>
                                                <div class="col-sm-10">
                                                    <input type="hidden" id="codProd">
                                                    <input type="text" id="descProd" style="width: 400px">
                                                </div>  
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="form-group">
                                                <label for="cantPed" class="col-sm-5 control-label">Cantidad</label>
                                                <div class="col-sm-7">
                                                    <input type="text" id="cantProd" value="0" class="form-control">
                                                </div>  
                                            </div>  
                                        </div>
                                        <div class="col-md-2">
                                            <div class="form-group">
                                                <div class="col-sm-8">
                                                    <button type="submit" id="agregarProd" style="margin-top: -1px" class="btn btn-blue"><i class="icon-plus"></i> Agregar</button>
                                                </div>  
                                            </div>  
                                        </div>
                                    </div>                                    
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-10">
                                <table id="tblProductos" class="table table-condensed table-bordered table-striped">
                                    <thead>
                                        <tr>
                                            <th>Código</th>
                                            <th>Producto</th>
                                            <th>Cantidad</th>
                                            <th></th>
                                        <tr>
                                    </thead>
                                    <tbody>
                                    </tbody>    
                                </table>
                            </div>
                            <div class="col-md-2">
                                <button id="guardarNotaPedido" class="btn btn-block micss guardarLarge">
                                    <i class="icon-save"></i>
                                    Guardar <span class="badge badge-danger" id="cantFil">0</span>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- end: DYNAMIC TABLE PANEL -->
            </div>
        </div>
    </div>    
</div>
<script type="text/javascript">
    $(function() {
        $("#guardarNotaPedido").click(function() {
            guardarNotaPedido();
        });       
         $("#tblProductos tbody tr").on("click",function (){
           alert("hola"); 
        });
    });
</script>